package com.ruoqing.core.vo.log;

import com.ruoqing.core.domain.rqlog.LogEntity;
import com.ruoqing.core.dto.BaseResponse;
import lombok.Data;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;

/**
	* @author YaoXian
	* @title: LogResponseVo
	* @projectName ruoxi-blog
	* @description: 若兮微服务 - 核心模块 - 日志服务 - 日志Rest接口VO表现对象
	* @date 2020-12-09 20:00
	*/
@Data
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class LogResponseVo extends BaseResponse {
		
		@XmlElement
		private LogEntity logEntity;
		
		@XmlElement
		private List<LogEntity> logList;
		
		public static LogResponseVo buildLogResponseVo(String status,String msg){
				LogResponseVo logResponseVo = new LogResponseVo();
				logResponseVo.setStatus(status);
				logResponseVo.setMessage(msg);
				return logResponseVo;
		}
		
		public static LogResponseVo buildLogResponseVo(String status,LogEntity logEntity){
				LogResponseVo logResponseVo = new LogResponseVo();
				logResponseVo.setStatus(status);
				logResponseVo.setLogEntity(logEntity);
				return logResponseVo;
		}
		
		public static LogResponseVo buildLogResponseVo(String status,List<LogEntity> logList){
				LogResponseVo logResponseVo = new LogResponseVo();
				logResponseVo.setStatus(status);
				logResponseVo.setLogList(logList);
				return logResponseVo;
		}
}
